import { Message } from "element-ui";

// 创建成功
function showCreateOk() {
  Message({
    message: "创建成功",
    type: "success",
  });
}

// 删除成功
function showRemoveOk() {
  Message({
    message: "删除成功",
    type: "success",
  });
}

// 编辑成功
function showEditOk() {
  Message({
    message: "编辑成功",
    type: "success",
  });
}
// 上传成功
function showUploadOk() {
  Message({
    message: "上传成功",
    type: "success",
  });
}
// 基础数据获取成功
function showDataOk() {
  Message({
    message: "基础数据获取成功",
    type: "success",
  });
}
// --------------------------------
// 创建失败
function showCreateNg(error) {
  Message({
    message: "创建失败: " + error.message,
    type: "error",
  });
}

// 删除失败
function showRemoveNg(error) {
  Message({
    message: "删除失败: " + error.message,
    type: "error",
  });
}

// 编辑失败
function showEditNg(error) {
  Message({
    message: "编辑失败: " + error.message,
    type: "error",
  });
}
// 上传失败
function showUploadNg(error) {
  Message({
    message: "上传失败: " + error.message,
    type: "error",
  });
}
// 列表刷新失败
function showFlushNg(error) {
  Message({
    message: "列表刷新失败: " + error.message,
    type: "error",
  });
}
// 基础数据获取失败
function showDataNg(error) {
  Message({
    message: "基础数据获取失败: " + error.message,
    type: "error",
  });
}

export {
  showCreateOk,
  showCreateNg,
  showFlushNg,
  showRemoveOk,
  showRemoveNg,
  showEditOk,
  showEditNg,
  showUploadOk,
  showUploadNg,
  showDataOk,
  showDataNg,
};
